<template>
	<div class="wrap">
	<xcl-header :page-title="pageTitle" :header-right="headerRight"></xcl-header>
	
	<div class="content">
		<div v-if="messageContent.length == 0" class="no-data">暂无数据</div>
	  	<div class="card" transition="scroll" v-for="p in messageContent" style="margin:0">
	        <div class="m-title">{{p.t}}</div>
	        <div class="m-time">{{p.ct | getLastTimeStr}}</div>
		    <div class="m-con">{{{p.c}}}</div>
	  	</div>
	</div>
	<xcl-loading :show="loading.show"></xcl-loading>
	</div>
</template>
<script>
import xclHeader from '../components/header.vue'
import xclFooter from '../components/footer.vue'
import xclLoading from '../components/loading.vue'
let MessageProxy =  require("../proxy/message_proxy");
let Message = new MessageProxy();
  export default {
        data (){
            return {
                scroll:true,
                pageTitle:'产品公告',
                messageId:this.$route.params.Id,
                headerRight:'',
                messageContent:[],            
                loading:{
                    show:false
                }
            }
        },
        route:{
        },
        methods:{
        	getMyProducts(){
        		var _this = this;
        		_this.loading.show = true;
        		Message.getBulletin(this.messageId,(d)=>{
        			if(d.code == 200 && d.results && d.results.length){
        				_this.messageContent = d.results;
        			}else{
                        _this.messageContent = [];
                    }
                    _this.loading.show = false;

        		});
        	},
        },
        ready(){
        	this.getMyProducts();
        },
        components:{
           "xclHeader":xclHeader,
           "xclFooter":xclFooter,
           "xclLoading":xclLoading,
        }
  }
</script>
<style lang="stylus">
.card
    padding .6rem
.m-title
    font-size .9rem
    text-align center
    color #333
.m-time
    font-size .7rem 
    text-align center
    color #999
.m-con
    line-height 1.2rem  
</style>